import { AREA } from "../config/config";
import { Chess, ChessInterface } from "./Chess";

export class Chariot extends Chess implements ChessInterface {
	public name: string = "车";
	public canMove(): Array<number> {
		// 保存返回值
		let p: Array<number> = []
		for (let i = 0; i <= AREA; i++) {
			if (i === this.position) continue
			// 把向上下左右的可移动点位加进总的可移动点位中
			p.push(...this.getTopMoviableArea())
			p.push(...this.getLeftMoviableArea())
			p.push(...this.getRigthMoviableArea())
			p.push(...this.getDownMoviableArea())
		}
		return p
	}
}